<%@ page language="java" contentType="text/html;charset=UTF-8"
   	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<script type="text/javascript">
	function submitMe(){
		document.forms["myupload"].action="myuploads.html";
		document.forms["myupload"].submit();
	}
</script>
<body>
<table cellpadding="0" cellspacing="0" width="690" align="center" border="0">
		<form action="myuploads.html" method="post" name="myupload">
		<tr>
			<td align="left" colspan="2">
			áž”áž„áŸ’áž áž¶áž‰áž¯áž€ážŸáž¶ážšáž�áž¶áž˜áž”áŸ’ážšáž—áŸ�áž‘ :&nbsp;
			<select name="txtcat" onchange="javascript:submitMe()">
				<option value="0">All Categories</option>
				<c:forEach var="y" begin="0" end="${fn:length(categories)-1 }" step="1" varStatus="status">
					<c:choose>
						<c:when test="${categories[y].CATEGORY_ID==curcategory}">
							<option selected="selected" value="${categories[y].CATEGORY_ID}">
								<c:out value="${categories[y].CATEGORY_NAME}"></c:out>
							</option>
						</c:when>
						
						<c:otherwise>
							<option value="${categories[y].CATEGORY_ID}">
								<c:out value="${categories[y].CATEGORY_NAME}"></c:out>
							</option>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</select>
			</td>
			<td colspan="2" align="right"><a href="uploadfile.html"><u>Upload áž¯áž€ážŸáž¶ážšáž�áŸ’áž˜áž¸</u></a></td>
		</tr>
		</form>
		<tr><td colspan="6" height="8"> </td></tr>
	<tr class="myuploadheader" align="center">	
		<td height="25" width="40%">áž…áŸ†ážŽáž„áž‡áž¾áž„</td>	
		<td width="40%">áž”ážšáž·áž™áž¶áž™</td>	
		<td width="10%">áž…áŸ‚áž€ážšáŸ†áž›áŸ‚áž€</td>
		<td width="10%">áž›áž»áž”áž…áŸ„áž›</td>
	</tr>
	<%
		String bgcolor="#EEE";
	%>
	<c:if test="${fn:length(data)>0}">
		<c:forEach var="x" begin="0" end="${fn:length(data)-1}" step="1" varStatus ="status">
			<%
				bgcolor=(bgcolor=="#EEE")?"#FFF":"#EEE";
			%>
				<c:if test="${x>=StartingRow && x<=EndingRow}">
					<tr bgcolor="<%=bgcolor%>" align="center">
						<td align="center" style="border-left:solid 1px #DDD; border-bottom:solid 1px #DDD; padding-bottom: 10px;padding-top: 10px;">&nbsp;<a href="edit_myupload.html?file_id=${data[x].FILE_ID}"><c:out value="${data[x].FILE_TITLE}"/></a></td>
						<td align="center" style="border-left:solid 1px #DDD; border-bottom:solid 1px #DDD;padding-right: 4px; padding-left: 4px;">
							<c:choose>
								<c:when test="${fn:length(data[x].FILE_DESC)>=80}">
									<c:out value="${fn:substring(data[x].FILE_DESC,0,80)}"/>...
								</c:when>
								<c:otherwise>
									<c:out value="${data[x].FILE_DESC}"/>
								</c:otherwise>
							</c:choose>
						</td>
						<td style="border-left:solid 1px #DDD; border-bottom:solid 1px #DDD;"><a href="share_file.html?file_id=${data[x].FILE_ID}"><img src="images/sharefile.png" width="25" height="25"></a></td>
						<td style="border:solid 1px #DDD; border-top:solid 0px #DDD;"><img src="images/remove.png" width="18" height="18" onclick="deleteUpload(${data[x].FILE_ID})" style="cursor: pointer;"></td>
					</tr>
				</c:if>
		</c:forEach>
	</c:if>
	<c:if test="${fn:length(data)<=0}">
		<tr>
			<td align="center" colspan="5" height="30" valign="bottom"> No file was uploaded</td>
		</tr>
	</c:if>
	<tr><td colspan="8" >&nbsp;</td></tr>
	<tr>
		<td height="30" valign="middle" colspan="8" align="center">
		<c:if test="${PageCount>1}">
			<c:if test="${page>1}">
				<a href="myuploads.html?page=${page-1}">áž”áž€áž€áŸ’ážšáŸ„áž™</a>
			</c:if>
			<c:if test="${page<=1}">
				<label style="color: #333">áž”áž€áž€áŸ’ážšáŸ„áž™</label>
			</c:if>
			&nbsp;
				<c:forEach var="i" begin="1" end="${PageCount}" step="1" varStatus ="status">
					<c:if test="${i==page}">
						<label style="color: #333; width: 25px; height: 10px; border: solid 1px;">&nbsp;<c:out value="${i}" />&nbsp;</label>
					</c:if>
					<c:if test="${i!=page}">
						<a href="myuploads.html?page=${i}" style="width: 25px; height: 10px;  border: solid 1px #CCC;">&nbsp;<c:out value="${i}" />&nbsp;</a>
					</c:if>
				</c:forEach>
			&nbsp;	
			<c:if test="${page<PageCount}">
				<a href="myuploads.html?page=${page+1}">áž‘áŸ…áž˜áž»áž�</a>
			</c:if>
			<c:if test="${page>=PageCount}">
				<label style="color: #333">áž‘áŸ…áž˜áž»áž�</label>
			</c:if>
		</c:if>
		</td>
	</tr>
</table>
</body>
</html>